package sk.avicularia.core.data;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import sk.avicularia.core.dao.AddressDAO;

/**
 * Entita mapujuca strukturu adresa
 * 
 * @author leaflock
 * @since  0.1
 */
@Entity
@Table(name = AddressDAO.TABLE_NAME)
public class Address implements Serializable
{
	/**
	 * @see Serializable
	 */
	private static final long	serialVersionUID	= 5585328140689721698L;

	/**
	 * Id zaznamu
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID", nullable = false)
	private Long id;
	
	/**
	 * Street adresy
	 */
	@Column(name = AddressDAO.COLUMN_STREET, nullable = false, length = 255)
	private String street;
	
	/**
	 * Town adresy
	 */
	@Column(name = AddressDAO.COLUMN_TOWN, nullable = false, length = 255)
	private String town;
	
	/**
	 * State adresy
	 */
	@Column(name = AddressDAO.COLUMN_STATE, nullable = false, length = 255)
	private String state;
	
	/**
	 * ZIP adresy
	 */
	@Column(name = AddressDAO.COLUMN_ZIP, length = 20)
	private String zip;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	public String getStreet()
	{
		return street;
	}

	public void setStreet(String street)
	{
		this.street = street;
	}

	public String getTown()
	{
		return town;
	}

	public void setTown(String town)
	{
		this.town = town;
	}

	public String getState()
	{
		return state;
	}

	public void setState(String state)
	{
		this.state = state;
	}

	public String getZip()
	{
		return zip;
	}

	public void setZip(String zip)
	{
		this.zip = zip;
	}
}
